/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.provider;


import java.util.Collection;
import java.util.List;

import kr.ac.knu.bkm0714.hl7.provider.Hl7EditPlugin;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.ecore.util.FeatureMapUtil;

import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.hl7.v3.StrucDocTd;
import org.hl7.v3.V3Factory;
import org.hl7.v3.V3Package;

/**
 * This is the item provider adapter for a {@link org.hl7.v3.StrucDocTd} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class StrucDocTdItemProvider
	extends ItemProviderAdapter
	implements	
		IEditingDomainItemProvider,	
		IStructuredItemContentProvider,	
		ITreeItemContentProvider,	
		IItemLabelProvider,	
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StrucDocTdItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addAbbrPropertyDescriptor(object);
			addAlignPropertyDescriptor(object);
			addAxisPropertyDescriptor(object);
			addCharPropertyDescriptor(object);
			addCharoffPropertyDescriptor(object);
			addColspanPropertyDescriptor(object);
			addHeadersPropertyDescriptor(object);
			addIDPropertyDescriptor(object);
			addLanguagePropertyDescriptor(object);
			addRowspanPropertyDescriptor(object);
			addScopePropertyDescriptor(object);
			addStyleCodePropertyDescriptor(object);
			addValignPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Abbr feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addAbbrPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_abbr_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_abbr_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Abbr(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Align feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addAlignPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_align_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_align_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Align(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Axis feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addAxisPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_axis_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_axis_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Axis(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Char feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_char_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_char_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Char(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Charoff feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharoffPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_charoff_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_charoff_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Charoff(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Colspan feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addColspanPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_colspan_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_colspan_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Colspan(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Headers feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addHeadersPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_headers_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_headers_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Headers(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the ID feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addIDPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_iD_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_iD_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_ID(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Language feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addLanguagePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_language_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_language_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Language(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Rowspan feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addRowspanPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_rowspan_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_rowspan_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Rowspan(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Scope feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addScopePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_scope_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_scope_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Scope(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Style Code feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addStyleCodePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_styleCode_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_styleCode_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_StyleCode(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Valign feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addValignPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_StrucDocTd_valign_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_StrucDocTd_valign_feature", "_UI_StrucDocTd_type"),
				 V3Package.eINSTANCE.getStrucDocTd_Valign(),
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
		if (childrenFeatures == null) {
			super.getChildrenFeatures(object);
			childrenFeatures.add(V3Package.eINSTANCE.getStrucDocTd_Mixed());
		}
		return childrenFeatures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EStructuralFeature getChildFeature(Object object, Object child) {
		// Check the type of the specified child object and return the proper feature to use for
		// adding (see {@link AddCommand}) it as a child.

		return super.getChildFeature(object, child);
	}

	/**
	 * This returns StrucDocTd.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/StrucDocTd"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		String label = ((StrucDocTd)object).getID();
		return label == null || label.length() == 0 ?
			getString("_UI_StrucDocTd_type") :
			getString("_UI_StrucDocTd_type") + " " + label;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(StrucDocTd.class)) {
			case V3Package.STRUC_DOC_TD__ABBR:
			case V3Package.STRUC_DOC_TD__ALIGN:
			case V3Package.STRUC_DOC_TD__AXIS:
			case V3Package.STRUC_DOC_TD__CHAR:
			case V3Package.STRUC_DOC_TD__CHAROFF:
			case V3Package.STRUC_DOC_TD__COLSPAN:
			case V3Package.STRUC_DOC_TD__HEADERS:
			case V3Package.STRUC_DOC_TD__ID:
			case V3Package.STRUC_DOC_TD__LANGUAGE:
			case V3Package.STRUC_DOC_TD__ROWSPAN:
			case V3Package.STRUC_DOC_TD__SCOPE:
			case V3Package.STRUC_DOC_TD__STYLE_CODE:
			case V3Package.STRUC_DOC_TD__VALIGN:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
			case V3Package.STRUC_DOC_TD__MIXED:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT,
					 "")));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT,
					 "")));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__PROCESSING_INSTRUCTION,
					 XMLTypeFactory.eINSTANCE.createProcessingInstruction())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA,
					 "")));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Content(),
					 V3Factory.eINSTANCE.createStrucDocContent())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_LinkHtml(),
					 V3Factory.eINSTANCE.createStrucDocLinkHtml())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Sub(),
					 V3Factory.eINSTANCE.createStrucDocSub())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Sup(),
					 V3Factory.eINSTANCE.createStrucDocSup())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Br(),
					 V3Factory.eINSTANCE.createStrucDocBr())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Footnote(),
					 V3Factory.eINSTANCE.createStrucDocFootnote())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_FootnoteRef(),
					 V3Factory.eINSTANCE.createStrucDocFootnoteRef())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_RenderMultiMedia(),
					 V3Factory.eINSTANCE.createStrucDocRenderMultiMedia())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_Paragraph(),
					 V3Factory.eINSTANCE.createStrucDocParagraph())));

		newChildDescriptors.add
			(createChildParameter
				(V3Package.eINSTANCE.getStrucDocTd_Mixed(),
				 FeatureMapUtil.createEntry
					(V3Package.eINSTANCE.getStrucDocTd_List(),
					 V3Factory.eINSTANCE.createStrucDocList())));
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return Hl7EditPlugin.INSTANCE;
	}

}
